class AcGameMenu_win {
    constructor(player) {
        this.player = player;
        this.$menu_win = $(`<div class="menu_win"><div class="ac-game-menu-win-field"><div class="ac-game-menu-win-field-item ac-game-menu-field-item-win-back">
            返回主界面
        </div></div></div>`);
        this.hide();
        this.player.playground.root.$ac_game.append(this.$menu_win);
        this.$win_back = this.$menu_win.find('.ac-game-menu-field-item-win-back');
        this.start();
    }

    start() {
        this.add_listening_events();
    }

    add_listening_events() {
        let outer = this;
        this.$menu_win.on("contextmenu", function() {
            return false;
        });
        this.$win_back.click(function(){
            // outer.hide();
            // outer.player.playground.before_menu.show();
            location.reload(true);
        });
    }

    show() {  // 显示menu界面
        this.$menu_win.show();
    }

    hide() {  // 关闭menu界面
        this.$menu_win.hide();
    }
}
